package com.twu.biblioteca;

/**
 * Created by csuarez on 17/01/14.
 */

public class Book implements Borrowable {

    private String title;
    private boolean availability;

    public Book(String title) {
        this.title = title;
        this.availability = true;
    }

    public String getTitle() {
        return title;
    }

    public void checkIn() {
        availability = true;
    }

    public void checkOut() {
        availability = false;
    }

    @Override
    public BorrowableType getType() {
        return BorrowableType.BOOK;
    }

    @Override
    public boolean canBeCheckedIn() {
        return availability == false;
    }

    @Override
    public boolean canBeCheckedOut() {
        return availability;
    }
}
